package com.wlps.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 商品表（commodity）
(1当有正在执行的订单时，不能删除商品。)
(如果是订购系统-订单的话不建议更新数据库建议更新redis到0的时候在更新数据库，也可以定时更新感觉可以使用这样的索引覆盖决定不习可以去掉)
 * </p>
 *
 * @author ZWYZY
 * @since 2020-07-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "commodity")
@ApiModel(value="Commodity对象", description="商品表（commodity） (1当有正在执行的订单时，不能删除商品。) (如果是订购系统-订单的话不建议更新数据库建议更新redis到0的时候在更新数据库，也可以定时更新感觉可以使用这样的索引覆盖决定不习可以去掉)")
public class Commodity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品代码")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品编号")
    private Long commodityCode;

    @ApiModelProperty(value = "一级分类名称")
    private String firstClassification;

    @ApiModelProperty(value = "二级分类名称")
    private String secondClassification;

    @ApiModelProperty(value = "计量单位")
    private String unitofmeasurement;

    @ApiModelProperty(value = "单价")
    private Double unitPrice;

    @ApiModelProperty(value = "金额")
    private Double amount;

    @ApiModelProperty(value = "折扣")
    private Double discount;

    @ApiModelProperty(value = "商品名称")
    private String productName;

    @ApiModelProperty(value = "商品说明")
    private String productDesccription;

    @ApiModelProperty(value = "库存量")
    private Long inventory;

    @ApiModelProperty(value = "成本价")
    private Double costPrice;

    @ApiModelProperty(value = "型号")
    private String model;

    @ApiModelProperty(value = "供应商")
    private String supplier;

    @ApiModelProperty(value = "厂商")
    private String vendor;

    @ApiModelProperty(value = "可否退货")
    private Boolean isReturn;

    @ApiModelProperty(value = "保质期限")
    private Date shelfLife;

    @ApiModelProperty(value = "可否换货")
    private Boolean isExchange;

    @ApiModelProperty(value = "备注")
    private String remark;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//数据库导出页面时json格式化
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//数据库导出页面时json格式化
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;


}
